package sg.simple.snmp.stats;

import java.util.HashMap;
import java.util.Map;

import org.snmp4j.smi.OID;

public enum OidCode {

	SYSTEM_DESCRIPTION("1.3.6.1.2.1.1.1.0", "System Description", String.class), NETWORK_UPTIME(
			"1.3.6.1.2.1.1.3.0", "Network up time", String.class), HOST_UPTIME(
			"1.3.6.1.2.1.25.1.1.0", "Host up time", String.class), CONTACT_PERSON_FOR_SYSTEM(
			"1.3.6.1.2.1.1.4.0", "Contact person for the system", String.class), NUMBER_OF_USER_SESSIONS(
			"1.3.6.1.2.1.25.1.5.0", "Number of user sessions", String.class), NUMBER_OF_PROCESS_CONTEXTS(
			"1.3.6.1.2.1.25.1.6.0", "Number of process contexts", String.class), SYSTEM_NAME(
			"1.3.6.1.2.1.1.5.0", "Machine Name", String.class), SYSTEM_LOCATION(
			"1.3.6.1.2.1.1.6.0", "Machine Location", String.class), MEMORY_IN_KILO_BYTES(
			"1.3.6.1.2.1.25.2.2.0", "Memory in KB", String.class),

	NUMBER_OF_NETWORK_INTERFACES("1.3.6.1.2.1.2.1.0",
			"Number of network interfaces present", String.class), NETWORK_INTERFACES(
			"1.3.6.1.2.1.2.2.1", "Network interfaces table", String.class);

	private OID oid;
	private String name;
	private Class clz;

	private OidCode(String oid, String name, Class clz) {
		this.oid = new OID(oid);
		this.name = name;
		this.clz = clz;
	}

	public OID getOid() {
		return oid;
	}

	public String getName() {
		return name;
	}

	public Class getClz() {
		return clz;
	}

	public static OidCode getByOid(OID oid) {

		return codes.get(oid);

	}

	private static Map<OID, OidCode> codes = new HashMap<OID, OidCode>();

	static {

		for (OidCode o : OidCode.values()) {
			codes.put(o.getOid(), o);
		}
	}

}
